﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TEL.TelPhoneF.Dialogs
{

    public partial class DialogContact : DialogCustom
    {
        public DialogContact()
        {
            InitializeComponent();
        }

        public object SourceObject
        {
            get { return bindingContact.DataSource; }
            set { bindingContact.DataSource = value; }
        }

        private DialogType m_DialigType = DialogType.View;
        public  DialogType DialigType
        {
            get { return m_DialigType; }
            set { m_DialigType = value;
            switch (m_DialigType)
            {
                case DialogType.Add:
                    this.Text = "Добавить контакт";
                    break;
                case DialogType.Edit:
                    this.Text = "Редактировать контакт";
                    break;
                case DialogType.Delete:
                    this.Text = "Удалить контакт";
                    txtContactName.ReadOnly = true;
                    txtContactNomer.ReadOnly = true;
                    break;
            }
            }
        }
    }
}
